package com.deity.news.dao;

//import java.util.Date;
//import java.util.List;

//import net.hongliang.util.HibernateUtil;

//import org.hibernate.Query;
//import org.hibernate.Session;
//import org.hibernate.Transaction;

   public class EventDao {
//
//	public static List findEvent(Date day, String source) {
//		List list = null;
//		Session session = HibernateUtil.currentSession();
//		Transaction tx = session.beginTransaction();
//		Query q = session.createQuery("from Event e where e.edate=:day and e.source=:source");
//		q.setString("source", source);
//		q.setDate("day", day);
//		list = q.list();
//		tx.commit();
//		return list;
//	}
//	public static List findMonthEvent(String yearmonth, String source) {
//		List list = null;
//		Session session = HibernateUtil.currentSession();
//		Transaction tx = session.beginTransaction();
//		Query q = session.createQuery("select to_char(e.edate,'dd') from Event e where to_date(to_char(edate,'yyyy-mm'),'yyyy-mm')=to_date('"+yearmonth+"','yyyy-mm') and e.source=:source");
//		q.setString("source", source);
//		list = q.list();
//		tx.commit();
//		return list;
//	}
}
